<?php
require_once("dbconnect.php");
require_once("admin_functions.php");
require_once("classes/mail.php");

chk_session();

//pagination code start here
$pagecount=15;

$pagecount_1=50;
if(!isset($_REQUEST['dir'])){
        $dir = "DESC";
} else {
        $dir = $_REQUEST['dir'];
}

if ($_REQUEST['b'] == ""){ $b=0; } else { $b = $_REQUEST['b'];} 
//pagination code ends here


$sql = "SELECT customer.customer_id, customer.name, customer.surname, customer.city, customer.tel, customer.mob, customer.paid FROM customer where paid = 'N'";

				$rs = mysql_query($sql) or die(mysql_error());
				$cnt = mysql_num_rows($rs);
                $sql .= " ORDER BY customer.customer_id DESC LIMIT $b, $pagecount_1";
                $rs = mysql_query($sql) or die(mysql_error());

?>
<?php require_once('include/header.php'); ?>
      <div id="middle_container_for_innerpage">
      <div id="innerpage_top_image"><img src="images/images/innerpage_top_corner_820x5.jpg"  height="5" /></div> 
      <div id="middle_inner_container">
      <?php require_once('include/left_side_menu.php'); ?>
	          
        <div id="inner_page_middle_data">
		<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#33CCFF">
  <tr>
    
    <td width="621" valign="top" ><p align="center" class="title"><br>
    Payment Pending </p>
      <p align="center" class="title">Total <?php echo $cnt; ?> Customer Pending for Payment.</p>
      <p align="center" class="title">Here is list of Unpaid Customer  </p>
      <table width="80%" border="1" align="center" cellpadding="0" cellspacing="0" class="homepage-search-header">
        <tr class="innerpage-header">
          <td width="12%" class="microsite-form-header"><div align="center" class="microsite-form-header">Customer Id </div></td>
          <td width="30%" class="microsite-form-header"><div align="center">Name</div></td>
          <td width="11%" class="microsite-form-header"><div align="center">City</div></td>
          <td width="27%" class="microsite-form-header"><div align="center">Telephone or Mobile </div></td>
          <td width="13%" class="microsite-form-header"><div align="center">Paid</div></td>
        </tr>
        <?
        if(@mysql_num_rows($rs)>0){
                                ?>
          <span class="subtitle">Total number of Profile <?php echo $b; ?> to <?php echo $pagecount_1+ $b; ?> out of <?php echo $cnt; ?> </span> </p>
        
     	 <? while($row=mysql_fetch_array($rs)){ ?>
          <tr>
            <td><div align="center"><?php echo $row['customer_id']; ?></div></td>
            <td><div align="center"><?php echo $row['name']; ?> <?php echo $row['surname']; ?></div></td>
            <td><div align="center"><?php echo $row['city']; ?></div></td>
            <td><div align="center"><?php echo $row['tel']; ?> , <?php echo $row['mob']; ?></div></td>
            <td><div align="center"><?php echo $row['paid']; ?></div></td>
          </tr>
          <?}

        } else {?>
          
        <p align="center" class="nomal">&nbsp;</p> 
			<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td class="mesg" colspan="6">Sorry !! No results found.</td>
        </tr>
        <?}?>
        <!--pagecount table starts here-->
        <? if ($cnt > $pagecount_1) {?>
        <tr>
          <td class="mesg" colspan="6"><?
                                                $qrystr="&sortBy=$sortBy&dir=$dir&gender=".$_REQUEST['gender']."&age_min=".$_REQUEST['age_min']."&age_max=".$_REQUEST['age_max']."&country=".$_REQUEST['country']."&city=".$_REQUEST['city']."&marital_status=".$_REQUEST['marital_status']."&feetInch=".$_REQUEST['feetInch']."&weightKg=".$_REQUEST['weightKg']."&degree=".$_REQUEST['degree']."&occupation=".$_REQUEST['occupation']."&mothertongue=".$_REQUEST['mothertongue'];
                                                displayPageNo($b,$cnt,$qrystr,"link-pagination",$pagecount_1);
                                        ?>        </td>
        </tr>
        <? } ?>
      </table>	
      </table>      
      <p align="center" class="title">&nbsp;</p></td>
  </tr>
</table>
        </div>
      </div> 
      <div id="corner_container_bottom_for_innerpage"><img src="images/images/innerpage_bottom_corner_820x10.jpg"  height="10" /></div>
    </div> 
      <!-- middle_container ends -->
    
    <div id="bottom_container">
<?php require_once('include/footer.php'); ?>
